package t.com.ui;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import org.greenrobot.eventbus.EventBus;

import butterknife.BindView;
import butterknife.ButterKnife;
import t.com.base.BaseActivity;
import t.com.been.MessageEvent;
import t.com.presenter.SecondPresenter;
import t.com.view.SecondView;

public class SecondActivity extends BaseActivity<SecondView,SecondPresenter> implements SecondView {

    @BindView(R.id.sBtn)
    Button sBtn;

    @Override
    protected void onCreateView(Bundle savedInstanceState) {
        setContentView(R.layout.activity_second);
    }

    @Override
    protected void initView() {
        super.initView();
        ButterKnife.bind(this);
    }

    @Override
    protected void initData() {
        super.initData();
        sBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                getBasePresenter().showStart();
            }
        });
    }

    @Override
    public void startIntent() {
        EventBus.getDefault().post(new MessageEvent("欢迎大家来看我写的代码"));
        finish();
    }


    @Override
    protected SecondPresenter setPresenter() {
        return new SecondPresenter();
    }
}
